<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="author" content="wangbo">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浏览器</title>
  <style>
    @font-face {
      font-family: 'icomoon';
      src: url('fonts/icomoon.eot?7accg8');
      src: url('fonts/icomoon.eot?7accg8#iefix') format('embedded-opentype'),
        url('fonts/icomoon.ttf?7accg8') format('truetype'),
        url('fonts/icomoon.woff?7accg8') format('woff'),
        url('fonts/icomoon.svg?7accg8#icomoon') format('svg');
      font-weight: normal;
      font-style: normal;
      font-display: block;
    }

    a {
      font-family: 'icomoon';
      font-size: 40px;
      margin-left: 20px;
      text-decoration: none;
      color: #333;
    }
  </style>
</head>

<body>
  <a href="JavaScript:void(0)"></a>
  <a href="JavaScript:void(0)"></a>
  <a href="JavaScript:void(0)"></a>
  <a href="JavaScript:void(0)"></a>
  <a href="JavaScript:void(0)"></a>
  <a href="JavaScript:void(0)"></a>
  <script>
    var aEle1 = document.querySelector("a:nth-child(1)")
    var aEle2 = document.querySelector("a:nth-child(2)")
    var aEle3 = document.querySelector("a:nth-child(3)")
    var aEle4 = document.querySelector("a:nth-child(4)")
    var aEle5 = document.querySelector("a:nth-child(5)")
    var aEle6 = document.querySelector("a:nth-child(6)")
    var mywin = null;
    aEle1.addEventListener("click", function () {
      window.history.back()
    })
    aEle2.addEventListener("click", function () {
      window.history.forward()
    })
    aEle3.addEventListener("click", function () {
      window.location.reload()
    })
    aEle4.addEventListener("click", () => {
      mywin = window.open('http://www.baidu.com', '',"width=200px,height=200px");
    })
    aEle5.addEventListener("click", function () {
      alert("收藏的标签是-->" + window.location.href)
    })
    aEle6.addEventListener("click", () => {
      mywin.close();
    })
  </script>
</body>

</html>